<!DOCTYPE html>

<html>

	<head>
		<meta charset="utf-8">
		<title>货道信息-编辑</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="layui/css/layui.css" media="all">
		<link rel="stylesheet" href="layui/css/admin.css" media="all">
		
		
	</head>

	<body>
		<div class="layui-fluid">
			<div class="layui-card">
				<div class="layui-card-header"><span style="font-weight: bold; font-size: 22px;">货道信息-编辑</span></div>
				<div class="layui-card-body" style="overflow: auto;  ">
					<div class="layui-upload" style="float: left; margin-left: 50px;" >
						<button type="button" class="layui-btn" id="test1" style="margin-left: 35px;">更换图片</button>
						<div class="layui-upload-list" style=" height: 160px; width: 160px; background-image: url(layui/images/pic.png);">
							<img class="layui-upload-img" id="demo1" style="height: 160px; width: 160px;">
                              <p id="demoText" ></p>
						</div>
						</div>
						<form class="layui-form" action=""  style="float: left; margin-left: 80px; ">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">货道号：</label>
								<div class="layui-input-inline">
									<input type="text" name="machineId" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">货道状态：</label>
								<div class="layui-input-inline">
									<select>
										<option value="">请选择状态</option>
										<option selected="">正常</option>
										<option>作废</option>

									</select>
								</div>
							</div>

						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">商品编码：</label>
								<div class="layui-input-inline">
									<input type="text" name="goodsId" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">商品名称：</label>
								<div class="layui-input-inline">
									<input type="text" name="goodsName" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>

						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">规格：</label>
								<div class="layui-input-inline">
									<input type="text" name="format" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">实际库存：</label>
								<div class="layui-input-inline">
									<input type="text" name="real" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>

						</div>
						<div class="layui-form-item">

							<div class="layui-inline">
								<label class="layui-form-label">商品类型：</label>
								<div class="layui-input-inline">
									<input type="text" name="goodstype" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">虚拟库存：</label>
								<div class="layui-input-inline">
									<input type="text" name="dummy" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
						<div class="layui-form-item">

							<label class="layui-form-label">说明：</label>
							<div class="layui-input-block">
								<input type="text" name="talk" lay-verify="required" autocomplete="off" class="layui-input">
							</div>

						</div>
						<div class="layui-form-item">
							<div class="layui-input-block" style="text-align: center;">
								<div class="layui-footer" style="left: 0;">
									<button class="layui-btn select">保存</button>

									<button class="layui-btn  layui-btn-warm" id="back">返回</button>
								</div>
							</div>
						</div>

					</form>
					</div>
					
				</div>
			</div>
		</div>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<script src="layui/layui.js"></script>
		<script>
			layui.use(['form', 'upload'], function() {
				var form = layui.form,
					upload = layui.upload;

				var uploadInst = upload.render({
					elem: '#test1',
					url: '/upload/',
					before: function(obj) {
						//预读本地文件示例，不支持ie8
						obj.preview(function(index, file, result) {
							$('#demo1').attr('src', result); //图片链接（base64）
						});
					},
					done: function(res) {
						//如果上传失败
						if(res.code > 0) {
							return layer.msg('上传失败');
						}
						//上传成功
					},
					error: function() {
						//演示失败状态，并实现重传
						var demoText = $('#demoText');
						demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
						demoText.find('.demo-reload').on('click', function() {
							uploadInst.upload();
						});
					}
				})

			});
			//$(function(){
			$('#back').click(function() {
				//alert(11)
				window.location.href = "Cargo.html";
				return false;
			});
			//});
		</script>
	</body>

</html>